﻿<%@ WebHandler Language="C#" Class="SendHouseSouFun" %>

using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Web;
using System.IO;
using System.Data;
using System.Xml;
using System.Web.Script.Serialization;
using System.Collections.Generic;
using System.Data.SqlClient;
using Chenxin.Lib.Utility;
using Chenxin.Lib.House.Entity;

public class SendHouseSouFun : AjaxHandlerBase
{

    private Encoding myEncoding = Encoding.GetEncoding("utf-8");
    private string picUrl_Title = System.Configuration.ConfigurationManager.AppSettings["Picture.RootUrl"];

    override public void RequestProcess(HttpContext context)
    {
        //chenxincs  321654
        context.Response.ContentType = "text/plain";
        context.Response.Buffer = true;
        context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
        context.Response.AddHeader("pragma", "no-cache");
        context.Response.AddHeader("cache-control", "");
        context.Response.CacheControl = "no-cache";
        if (context.Request["SouFunUserId"] == "undefined" || context.Request["SouFunUserPwd"] == "undefined")
        {
            context.Response.Write("{success:'0',msg:'请输入用户ID和密码',data:''}");
            return;
        }
        if (context.Request["SouFunHouseTitle"] == "undefined")
        {
            context.Response.Write("{success:'0',msg:'请输入房源标题',data:''}");
            return;
        }
        House_BaseInfo model = null;
        model = (House_BaseInfo)JsonHelp.Convert2Entity(context.Request["SouFunHouseInfo"], typeof(House_BaseInfo));
        string xmlData = "";
        string bussinessType = model.BusinessKind == 10 ? "SaleHouses" : "LeaseHouses";
        XmlNode xl = null;
        if (model.HouseUse == "住宅" || model.HouseUse == "其他" || model.HouseUse == "商住两用")
        {
            com.soufun.test.agentinterfaces.Service soufun = new com.soufun.test.agentinterfaces.Service();
            if (model.BusinessKind == 20)  //租
            {
                xmlData = this.GetRentHouseXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            else
            {
                xmlData = this.GetSaleHouseXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            xl = soufun.Import(context.Request["SouFunUserId"], context.Request["SouFunUserPwd"], bussinessType, xmlData);
        }
        if (model.HouseUse == "商铺" || model.HouseUse == "车位")
        {
            com.soufun.test.agentinterfaces.ServiceShops soufunShops = new com.soufun.test.agentinterfaces.ServiceShops();
            if (model.BusinessKind == 20)
            {
                xmlData = this.GetRentMarketXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            else
            {
                xmlData = this.GetSaleMarketXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            xl = soufunShops.Import(context.Request["SouFunUserId"], context.Request["SouFunUserPwd"], bussinessType, xmlData);
        }
        if (model.HouseUse == "办公" || model.HouseUse == "厂房")
        {
            com.soufun.test.agentinterfaces.ServiceOffices soufunOffice = new com.soufun.test.agentinterfaces.ServiceOffices();
            if (model.BusinessKind == 20)
            {
                xmlData = this.GetRentOfficeXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            else
            {
                xmlData = this.GetSaleOfficeXml(model, context.Request["SouFunHouseTitle"], context.Request["SouFunUserId"]);
            }
            xl = soufunOffice.Import(context.Request["SouFunUserId"], context.Request["SouFunUserPwd"], bussinessType, xmlData);
        }
        string return_msg = "";
        if (xl.SelectSingleNode("result").InnerText != "true")
        {
            return_msg = xl.SelectSingleNode("msg").InnerText;
            context.Response.Write("{success:'0',msg:'" + return_msg + "',data:''}");
            return;
        }
        else
        {
            if (xl.SelectSingleNode("returnmsg").SelectSingleNode("returncode").InnerText != "m000")
            {
                return_msg = xl.SelectSingleNode("returnmsg").SelectSingleNode("returncode").InnerText;
                context.Response.Write("{success:'0',msg:'" + return_msg + "',data:''}");
                return;
            }
            else
            {
                return_msg = "推送成功";
                context.Response.Write("{success:'1',msg:'房源推送成功',data:''}");
                return;
            }
        }
    }


    private string GetSaleHouseXml(House_BaseInfo model, string houseTitle, string userName)  //售住宅
    {
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");               //房源标题
        sb.Append("<projname>" + model.Community + "</projname>");                               //楼盘名称
        sb.Append("<district>" + model.Region + "</district>");                                              //区县
        sb.Append("<comarea>" + commarea + "</comarea>");                                     //商圈
        sb.Append("<address>" + model.Address + "</address>");                                     //物业地址
        sb.Append("<purpose>住宅</purpose>");                                           //物业类型
        sb.Append("<propertysubtype>" + model.BuildingType + "</propertysubtype>");           //住宅类别
        sb.Append("<room>" + model.Model_Room.ToString() + "</room>");                                                           //室
        sb.Append("<hall>" + model.Model_Hall.ToString() + "</hall>");                                                               //厅
        sb.Append("<toilet>" + model.Model_Toilet.ToString() + "</toilet>");                                                           //卫生间
        sb.Append("<kitchen>1</kitchen>");                                                    //厨房 默认为1
        sb.Append("<balcony>" + model.Model_Balcony.ToString() + "</balcony>");                                                   //阳台
        // sb.Append("<housestructure>平层</housestructure>");                       //房屋结构     (暂时缺省)
        //sb.Append("<buildingtype>板楼</buildingtype>");                               //建筑类别
        sb.Append("<mright>" + model.Property + "</mright>");                                         //产权性质
        sb.Append("<price>" + Convert.ToString(model.SalePrice_T / 10000) + "</price>");                                                     //出售价格
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");                                  //建筑面积
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");                                          //使用面积
        sb.Append("<innerid>" + code + "</innerid>");                                         //内部编号
        //sb.Append("<infocode>585658545858</infocode>");                             //房源信息码
        sb.Append("<limitdate>60</limitdate>");                                                //有效期
        sb.Append("<floor>" + model.Cur_Floor.ToString() + "</floor>");                                                             //楼层
        sb.Append("<totlefloor>" + model.Total_Floor.ToString() + "</totlefloor>");                                               //总层数
        sb.Append("<createtime>" + model.CompleteYear.ToString() + "</createtime>");                                    //建筑年代
        sb.Append("<forward>" + model.Direction + "</forward>");                                                 //朝向
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");   //配套设施
        sb.Append("<fitment>" + model.Fitment + "</fitment>");                                              // 装修程度
        sb.Append("<lookhousetype>随时看房</lookhousetype>");                //看房时间
        sb.Append("<trafficinfo>交通方便</trafficinfo>");                               //交通状况
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");        //周边配套
        sb.Append("<description>" + model.Remarks + "</description>");                              //房源描述
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");                //图片名称,多个按‘,’分隔。图片名称只能为汉字
        sb.Append("<imgurl>" + picUrl + "</imgurl>");   //图片地址，多个按‘,’分隔
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();
    }

    private string GetRentHouseXml(House_BaseInfo model, string houseTitle, string userName)    //租住宅
    {
        string ispartner = model.IsGroup == true ? "1" : "0";
        string payinfo = model.PayMode == "其他" ? "面议" : "季付：押一付三";
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");
        sb.Append("<projname>" + model.Community + "</projname>");
        sb.Append("<district>" + model.Region + "</district>");
        sb.Append("<comarea>" + commarea + "</comarea>");
        sb.Append("<address>" + model.Address + "</address>");
        sb.Append("<purpose>住宅</purpose>");
        sb.Append("<room>" + model.Model_Room.ToString() + "</room>");
        sb.Append("<hall>" + model.Model_Hall.ToString() + "</hall>");
        sb.Append("<toilet>" + model.Model_Toilet.ToString() + "</toilet>");
        sb.Append("<kitchen>1</kitchen>");
        sb.Append("<balcony>" + model.Model_Balcony.ToString() + "</balcony>");
        //sb.Append("<housestructure>平层</housestructure>");                       //房屋结构     (暂时缺省)
        sb.Append("<price>" + model.RentPrice.ToString() + "</price>");
        sb.Append("<ispartner>" + ispartner + "</ispartner>");
        sb.Append("<payinfo>" + payinfo + "</payinfo>");
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");
        sb.Append("<innerid>" + code + "</innerid>");
        //sb.Append("<infocode>585658545858</infocode>");
        sb.Append("<limitdate>30</limitdate>");
        sb.Append("<floor>" + model.Cur_Floor.ToString() + "</floor>");
        sb.Append("<totlefloor>" + model.Total_Floor.ToString() + "</totlefloor>");
        sb.Append("<createtime>" + model.CompleteYear.ToString() + "</createtime>");
        sb.Append("<forward>" + model.Direction + "</forward>");
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");
        sb.Append("<equitment>" + model.BaseEquip + "</equitment>");
        sb.Append("<fitment>" + model.Fitment + "</fitment>");
        sb.Append("<lookhousetype>随时看房</lookhousetype>");
        sb.Append("<trafficinfo>交通方便</trafficinfo>");
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");
        sb.Append("<description>" + model.Remarks + "</description>");
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");
        sb.Append("<imgurl>" + picUrl + "</imgurl>");
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();
    }

    private string GetSaleMarketXml(House_BaseInfo model, string houseTitle, string userName)      //售商铺
    {
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        string floor = model.Cur_Floor == null ? "1" : model.Cur_Floor.ToString();
        string totlefloor = model.Total_Floor == null ? "1" : model.Total_Floor.ToString();
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");
        sb.Append("<projname>" + model.Community + "</projname>");
        sb.Append("<district>" + model.Region + "</district>");
        sb.Append("<comarea>" + commarea + "</comarea>");
        sb.Append("<address>" + model.Address + "</address>");
        sb.Append("<purpose>商铺</purpose>");//唯一值商铺-->
        sb.Append("<propertysubtype>" + model.BuildingType + "</propertysubtype>");
        //sb.Append("<shoptype>" + model.BuildingType + "</shoptype>"); //铺面类型—>
        sb.Append("<price>" + Convert.ToString(model.SalePrice_T / 10000) + "</price>");
        sb.Append("<propertyfee>1</propertyfee>"); // <!—物业费-->
        //sb.Append("<propertycompany>第一道物业公司</propertycompany>");大 // <!—物业公司-->
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");
        sb.Append("<floor>" + floor + "</floor>");
        sb.Append("<totlefloor>" + totlefloor + "</totlefloor>");
        sb.Append("<createtime>" + model.CompleteYear.ToString() + "</createtime>");
        //sb.Append("<isdivisibility>不可分割</isdivisibility>"); //<!—是否可分割-->
        sb.Append("<fitment>" + model.Fitment + "</fitment>");
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");
        sb.Append("<aimoperastion>百货,酒店,连锁超市/卖场/折扣店,家居建材,服装/服饰,生活服务,饰品/化妆品,鞋/皮具/箱包,餐饮文化,  健身健康/娱乐/休闲,其他专业店</aimoperastion>");  //<!—目标业态-->
        sb.Append("<innerid>" + code + "</innerid>");
        sb.Append("<description>" + model.Remarks + "</description>");
        sb.Append("<trafficinfo>交通方便</trafficinfo>");
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");
        sb.Append("<imgurl>" + picUrl + "</imgurl>");
        sb.Append("<limitdate>60</limitdate>");
        //sb.Append("<infocode>585658545858</infocode>");
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();

    }

    private string GetRentMarketXml(House_BaseInfo model, string houseTitle, string userName)      //租商铺
    {
        string ispartner = model.IsGroup == true ? "1" : "0";
        string payinfo = model.PayMode == "其他" ? "面议" : "季付：押一付三";
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        string floor = model.Cur_Floor == null ? "1" : model.Cur_Floor.ToString();
        string totlefloor = model.Total_Floor == null ? "1" : model.Total_Floor.ToString();
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");
        sb.Append("<projname>" + model.Community + "</projname>");
        sb.Append("<district>" + model.Region + "</district>");
        sb.Append("<comarea>" + commarea + "</comarea>");
        sb.Append("<address>" + model.Address + "</address>");
        sb.Append("<purpose>商铺</purpose>");  //<!--唯一值商铺-->
        sb.Append("<propertysubtype>" + model.BuildingType + "</propertysubtype>");
        //sb.Append("<shoptype>" + model.BuildingType + "</shoptype>");  // <!—铺面类型—>
        sb.Append("<price>" + model.RentPrice.ToString() + "</price>");
        sb.Append("<isincludefee>否</isincludefee>");   // <!—是否含物业费-->
        sb.Append("<propertyfee>1</propertyfee>");  // <!—物业费-->
        //sb.Append("<propertycompany>第一大道物业公司</propertycompany>");   // <!—物业公司-->
        sb.Append("<ispartner>" + ispartner + "</ispartner>");    //<!—租赁方式-->
        sb.Append("<payinfo>" + payinfo + "</payinfo>");   //<!—支付方式-->
        sb.Append("<leaseleastyear>50</leaseleastyear>");  //<!—起租年限-->
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");
        sb.Append("<floor>" + floor + "</floor>");
        sb.Append("<totlefloor>" + totlefloor + "</totlefloor>");
        //sb.Append("<isdivisibility>不可分割</isdivisibility>");   //<!—是否可分割-->
        sb.Append("<fitment>" + model.Fitment + "</fitment>");
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");
        sb.Append("<aimoperastion>百货,酒店,连锁超市/卖场/折扣店,家居建材,服装/服饰,生活服务,饰品/化妆品,鞋/皮具/箱包,餐饮文化,  健身健康/娱乐/休闲,其他专业店</aimoperastion>");  // <!—目标业态-->
        sb.Append("<innerid>" + code + "</innerid>");
        sb.Append("<description>" + model.Remarks + "</description>");
        sb.Append("<trafficinfo>交通方便</trafficinfo>");
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");
        sb.Append("<imgurl>" + picUrl + "</imgurl>");
        sb.Append("<limitdate>30</limitdate>");
        //sb.Append("<infocode>585658545858</infocode>");
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();

    }


    private string GetSaleOfficeXml(House_BaseInfo model, string houseTitle, string userName)        //售写字楼
    {
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        string floor = model.Cur_Floor == null ? "1" : model.Cur_Floor.ToString();
        string totlefloor = model.Total_Floor == null ? "1" : model.Total_Floor.ToString();
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");
        sb.Append("<projname>" + model.Community + "</projname>");
        sb.Append("<district>" + model.Region + "</district>");
        sb.Append("<comarea>" + commarea + "</comarea>");
        sb.Append("<address>" + model.Address + "</address>");
        sb.Append("<purpose>写字楼</purpose>");  //<!--唯一值写字楼-->
        sb.Append("<price>" + Convert.ToString(model.SalePrice_T / 10000) + "</price>");
        sb.Append("<propertyfee>0</propertyfee>");  // <!—物业费-->
        //sb.Append("<propertycompany>第一大道物业公司</propertycompany>");  // <!—物业公司-->
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");
        sb.Append("<floor>" + floor + "</floor>");
        sb.Append("<totlefloor>" + totlefloor + "</totlefloor>");
        sb.Append("<createtime>" + model.CompleteYear.ToString() + "</createtime>");
        //sb.Append("<isdivisibility>不可分割</isdivisibility>");   //<!—是否可分割-->
        sb.Append("<fitment>" + model.Fitment + "</fitment>");
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");
        //sb.Append("<propertygrade>甲级</propertygrade> ");  //<!—写字楼级别-->
        sb.Append("<propertysubtype>纯写字楼</propertysubtype>");    // <!—写字楼类型-->
        sb.Append("<innerid>" + code + "</innerid>");
        sb.Append("<description>" + model.Remarks + "</description>");
        sb.Append("<trafficinfo>交通方便</trafficinfo>");
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");
        sb.Append("<imgurl>" + picUrl + "</imgurl>");
        sb.Append("<limitdate>60</limitdate>");
        //sb.Append("<infocode>585658545858</infocode>");
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();

    }


    private string GetRentOfficeXml(House_BaseInfo model, string houseTitle, string userName)       //租写字楼
    {
        string ispartner = model.IsGroup == true ? "1" : "0";
        string payinfo = model.PayMode == "其他" ? "面议" : "季付：押一付三";
        string code = userName + model.HouseId.ToString().Substring(0, 4);
        List<House_PicturesInfo> pic_list = Chenxin.Lib.House.DAL.House_PicturesInfo.GetListArray("HouseId='" + model.HouseId.ToString() + "'");
        StringBuilder sb = new StringBuilder();
        string commarea = model.HouseBlock == "" ? model.Region : model.HouseBlock;
        string floor = model.Cur_Floor == null ? "1" : model.Cur_Floor.ToString();
        string totlefloor = model.Total_Floor == null ? "1" : model.Total_Floor.ToString();
        sb.Append("<?xml version='1.0' encoding='gb2312'?>");
        sb.Append("<houses>");
        sb.Append("<houseinfo>");
        sb.Append("<title>" + houseTitle + "</title>");
        sb.Append("<projname>" + model.Community + "</projname>");
        sb.Append("<district>" + model.Region + "</district>");
        sb.Append("<comarea>" + commarea + "</comarea>");
        sb.Append("<address>" + model.Address + "</address>");
        sb.Append("<purpose>写字楼</purpose>");   //<!--唯一值写字楼-->
        sb.Append("<price>" + model.RentPrice.ToString() + "</price>");
        sb.Append("<isincludefee>否</isincludefee>");  // <!—是否含物业费-->
        sb.Append("<propertyfee>1</propertyfee>");  // <!—物业费-->
        //sb.Append("<propertycompany>第一大道物业公司</propertycompany>"); //<!—物业公司-->
        sb.Append("<ispartner>" + ispartner + "</ispartner>"); //<!—租赁方式-->
        sb.Append("<payinfo>" + payinfo + "</payinfo>");  //<!—支付方式-->
        sb.Append("<leaseleastyear>50</leaseleastyear>");   //<!—起租年限-->
        sb.Append("<buildingarea>" + model.BuildingArea.ToString() + "</buildingarea>");
        //sb.Append("<livingarea>" + model.BuildingArea.ToString() + "</livingarea>");
        sb.Append("<floor>" + floor + "</floor>");
        sb.Append("<totlefloor>" + totlefloor + "</totlefloor>");
        //sb.Append("<isdivisibility>不可分割</isdivisibility>");   //<!—是否可分割-->
        sb.Append("<fitment>" + model.Fitment + "</fitment>");
        sb.Append("<baseservice>" + model.BaseEquip + "</baseservice>");
        //sb.Append("<propertygrade>甲级</propertygrade>");  // <!—写字楼级别-->
        sb.Append("<propertysubtype>纯写字楼</propertysubtype>");  // <!—写字楼类型-->
        sb.Append("<innerid>" + code + "</innerid>");
        sb.Append("<description>" + model.Remarks + "</description>");
        sb.Append("<trafficinfo>交通方便</trafficinfo>");
        //sb.Append("<aroundinfo>大学、小学、幼儿园</aroundinfo>");
        string picUrl = "";
        string picName = "";
        int temp = 0;
        foreach (House_PicturesInfo pic in pic_list)
        {
            ++temp;
            if (pic_list.Count == temp)
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl;
                picName = picName + pic.PicType;
            }
            else
            {
                picUrl = picUrl + picUrl_Title + pic.MarkedUrl + ",";
                picName = picName + pic.PicType + ",";
            }
        }
        sb.Append("<imgname>" + picName + "</imgname>");
        sb.Append("<imgurl>" + picUrl + "</imgurl>");
        sb.Append("<limitdate>30</limitdate>");
        //sb.Append("</infocode>");
        sb.Append("</houseinfo>");
        sb.Append("</houses>");
        return sb.ToString();
    }

}